package self;

public class SecPolymorphism1 {
    public static void main(String[] args) {
        Animal c = new Bird();
        c.shout();
    }
}
abstract class Animal{
    abstract void shout();
    void walk(){
        System.out.println("animal.walk");
    }
    void shout2(Animal a){
        a.shout();
    }
}
class Bird extends Animal {
    void shout(){
        System.out.println("bird.shout");
    }
    void fly(){
        System.out.println("bird.fly");
    }
}

class Dog extends Animal {
    void shout(){
        System.out.println("dog.shout");
    }
    void swim(){
        System.out.println("dog.fly");
    }
}
